import request from '@/utils/request'

// 查询报修信息列表
export function listRepair(query) {
  return request({
    url: '/smartdor/repair/list',
    method: 'get',
    params: query
  })
}

// 查询报修详细
export function getRepair(bstudentId) {
  return request({
    url: '/smartdor/repair/' + bstudentId,
    method: 'get'
  })
}


// 新增报修信息
export function addRepair(data) {
   //that.$refs.uploadxls.submit() // 提交时触发了before-upload函数
  return request({
    url: '/smartdor/repair/create',
    method: 'post',
    data: data
  })
}

// 修改报修信息
export function updateRepair(id,data) {
  return request({
    url: '/smartdor/repair/update/' + id,
    method: 'put',
    data: data
  })
}

// 删除报修信息
export function delRepair(id) {
  return request({
    url: '/smartdor/repair/deleteByIds/' + id,
    method: 'delete'
  })
}



// 获取字典选择框列表
export function optionselect() {
  return request({
    url: '/basedata/dict/optionselect',
    method: 'get'
  })
}

// 报修状态修改
export function changeRepairStatus(bstudentId, status) {
  const params = {
    status
  }
  return request({
    url: '/smartdor/repair/update/status/' + bstudentId,
    method: 'put',
    params: params
  })
}
